
package com.cloud.rapid.project.controller;

import com.cloud.rapid.project.entity.RpProject;
import com.cloud.rapid.project.service.RpProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 项目
 */
@RestController
@RequestMapping("/project")
public class ProjectController {

    @Autowired
    private RpProjectService projectService;

    @GetMapping(value = {"/info"})
    public List<RpProject> info() {
        List<RpProject> data = projectService.listProject();
        return data;
    }

    @GetMapping(value = {"/update"})
    public void updateProject(String id, String name) {
        projectService.updateProjectById(id, name);
    }
}
